<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>then 方法 catch</title>
  </head>
  <body>
    <script>
      let p = new Promise((resolve, reject) => {
        // resolve('Success');
        reject("Error");
      });

      //catch 是实例对象身上的方法, 用来指定失败的回调
      // 只有 then 方法功能的一半
      p.catch((reason) => {
        console.log(reason);
      });
    </script>
  </body>
</html>
